package com.ctshk.rpc.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ctshk.rpc.system.dto.UserDTO;
import com.ctshk.rpc.system.entity.SysUser;
import com.ctshk.rpc.system.req.AddSysUserReq;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 谢诗宏
 * @description com.ctshk.rpc.system.mapper
 * @date 2020/12/9
 */
public interface SysUserMapper extends BaseMapper<SysUser> {

    @Select("select tsu.*, tsd.title dept from t_sys_user tsu left join t_sys_department tsd on tsu.dept_id = tsd.id")
    IPage<UserDTO> pageUser(IPage<UserDTO> page);

    @Select("select su.*,sd.dept_code from t_sys_user su left join t_sys_department sd on su.dept_id = sd.id")
    List<UserDTO> selectDTOList();
}
